]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
portalHelper: Add extra check for policy decision type
authorMichael Catanzaro <mcatanzaro@redhat.com>
Sun, 27 Jul 2025 15:35:58 +0000 (17:35 +0200)
committerMarge Bot <marge-bot@gnome.org>
Sun, 3 Aug 2025 19:15:28 +0000 (19:15 +0000)
This check will always be true currently, because there are only three
possible types of policy decisions, and both of the others are already
handled above. But if new policy decision types are ever added in the
future, then we probably don't want to execute this code.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3813>

js/portalHelper/main.js

index 9d420138c74e31437ba420b41b80eef455afcc6a..60b419d454d28a2b5b1cdc697a88057df83a4058 100644 (file)
@@ -238,6 +238,9 @@ class PortalWindow extends Gtk.ApplicationWindow {
             return true;
         }
 
+        if (type !== WebKit.PolicyDecisionType.NAVIGATION_ACTION)
+            return false;
+
         const uri = GLib.Uri.parse(request.get_uri(), HTTP_URI_FLAGS);
 
         if (uri.get_host() !== this._uri.get_host() && this._originalUrlWasGnome) {